﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Web.Management;

namespace dao.daos
{
    public class ProfesorDao : BaseDao 
    {
        public ProfesorDao()
            : base("profesores", "id_profesor", true)
        {

        }

        public DataTable ObtenerPorId(int id)
        {
            Conectar();
            DataTable dt = new DataTable();
            try
            {
                Cmd.CommandText = "SELECT * from " + NombreTabla + " where id_profesor = " + id;
                dt.Load(Cmd.ExecuteReader());                
                return dt;

            }
            catch (Exception e)
            {
                throw new SqlExecutionException("Error al obtener club por razón social", e);
            }
            Conexion.Close();
        }

        public DataTable obtenerTiposDoc()
        {
            DataTable dt = new DataTable();
            Conectar();
            Cmd.CommandText = "SELECT * FROM tipos_documentos";
            dt.Load(Cmd.ExecuteReader());
            Conexion.Close();
            return dt;
        }
    }
}
